package Assignment;

import java.util.Scanner;

public class Test5 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入工资金额:");
        double salary = scanner.nextDouble();

        //扣除三险一金的工资后
        double realWages = salary - salary * 0.1;


        if (realWages >= 5000) {
            double money = realWages - 5000;
            if (money <= 3000) {
                //税
                double tax = money * 0.03;
                realWages -= tax;
                System.out.println("纳税数:" + tax + "税后工资为:" + realWages);
            } else if (money > 3000 && money <= 12000) {
                double tax = 3000 * 0.03 + (money - 3000) * 0.1;
                realWages -= tax;
                System.out.println("纳税数:" + tax + "税后工资为:" + realWages);
            } else if (money > 12000 && money <= 25000) {
                double tax = 3000 * 0.03 + (12000 - 3000) * 0.1 + (money - 12000) * 0.2;
                realWages -= tax;
                System.out.println("纳税数:" + tax + "税后工资为:" + realWages);
            } else if (money > 25000 && money <= 35000) {
                double tax = 3000 * 0.03 + (12000 - 3000) * 0.1 + (25000 - 12000) * 0.2 + (money - 2500) * 0.25;
                realWages -= tax;
                System.out.println("纳税数:" + tax + "税后工资为:" + realWages);
            } else if (money > 35000 && money <= 55000) {
                double tax = 3000 * 0.03 + (12000 - 3000) * 0.1 + (25000 - 12000) * 0.2 + (35000 - 25000) * 0.25 + (money - 35000) * 0.3;
                realWages -= tax;
                System.out.println("纳税数:" + tax + "税后工资为:" + realWages);
            } else if (money > 55000 && money <= 80000) {
                double tax = 3000 * 0.03 + (12000 - 3000) * 0.1 + (25000 - 12000) * 0.2 + (35000 - 25000) * 0.25 + (55000 - 35000) * 0.3 + (money - 35000) * 0.35;
                realWages -= tax;
                System.out.println("纳税数:" + tax + "税后工资为:" + realWages);
            } else {
                double tax = 3000 * 0.03 + (12000 - 3000) * 0.1 + (25000 - 12000) * 0.2 + (35000 - 25000) * 0.25 + (55000 - 35000) * 0.3 + (80000 - 55000) * 0.35 + (money - 80000) * 0.45;
                realWages -= tax;
                System.out.println("纳税数:" + tax + "税后工资为:" + realWages);
            }

        } else if (realWages > 0) {
            System.out.println("纳税数:" + 0 + "税后工资为:" + realWages);
        } else {
            System.out.println("请输入正确数值！");
        }
    }
}
